<%@page pageEncoding="UTF-8" contentType="text/html;charset=utf-8" errorPage="/commons/error.jsp"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='zh-CN' xml:lang='zh-CN' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>品类</title>
<style type="text/css">
table{font-size: 12px;}
</style>
</head>
<body>
<p>更新品类信息：<a href = '${ctx}/admin/catalog/detail/${catalog.id }'>${catalog.name}</a></p>
<hr />
<div>
	<c:if test="${result != null && result.code != 0}">
		<span style="color: red">Warning: ${result.msg }</span>
	</c:if>
	<c:if test="${result.code == 0}">
		<span style="color: blue">${result.msg }</span>
	</c:if>
</div>
<form:form id="form-update" class="form-inline" commandName="catalog" action="${ctx}/admin/catalog/update" method="post">
		<form:hidden path="id" />
		<table class="table table-striped">
			<tr>
				<td><label for="name">名称</label></td>
				<td><form:input path="name" class="form-control width-200"
						placeholder="品类名称" /></td>
			</tr>
			<tr>
				<td><label>激活</label></td>
				<td><form:checkbox path="active" /></td>
			</tr>
			<tr>
				<td colspan="2">
					<button type="submit" class="btn btn-primary">更新</button>
				</td>
			</tr>
		</table>
	</form:form>
<script type="text/javascript" src="${ctx}/scripts/lottery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#nav_product").addClass("active");
	});
</script>
</body>
</html>